package com.atguigu.common.valid;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @Author: WackyBoy
 * @Date: 2021/6/21 15:02
 * 自定义校验注解
 */
@Documented
@Constraint(validatedBy = {ListValueConstraintValidator.class})     //Marks an annotation as being a Bean Validation constraint.
// 注解可以标注在哪些位置
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
// 注解的运行时机
@Retention(RUNTIME)

public @interface ListValue {

    String message() default "{com.atguigu.common.valid.ListValue.message}";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

    int[] vals() default { } ;

}
